Copyright (C) 2022 Intel Corporation

Intel(R) Active Management Technology (Intel(R) AMT):
A short description of the HostBasedSetupTyped sample code for the usage of 
developers.

HostBasedSetupTyped sample application:
---------------------------------------
This sample application demonstrates how to setup an Intel(R) AMT device in
client control mode, after the setup is done, the device will be ready to be
configured. This sample runs locally on the AMT device.
In addition, the sample application demonstrates how to discover, disable and
unprovision an Intel(R) AMT device in client control mode. 

Sample supports Host Based Setup provisioning over TLS, for ME19 and above, where
 TLS is enforced from the local interface. 

Note:   To ensure that security is maintained, the application should be run from 
        a directory that can be accessed only by the Administrator user. This is 
        to prevent unauthorized manipulation of files in the directory.
        
How to compile and run the sample:
----------------------------------
1. Open the "HostBasedSetupTyped.vcxproj" in Microsoft Visual Studio* and build
   the solution. An output file "HostBasedSetup.exe" file should be created. 
2. Use the generated executable as described in the command usage (type the 
   Command to obtain the usage instructions).
3. This sample performs all of its WS-Management calls in TCP mode using the
   $$OsAdmin credentials (retrieved by the sample itself).
4. This sample uses the OpenWSMAN library by referencing the WS-Management 
   module dlls/libs. 
5. This sample application uses the files CPPCimFrameworkUntyped.dll and 
   CPPCimFramework.dll (or CPPCimFrameworkUntypedD.dll and CPPCimFrameworkD.dll
   when compiled in Debug mode). Make sure CPPCimFrameworkUntyped.dll and 
   CPPCimFramework.dll are located in the same directory as the application. 
   In order to generate the CPPCimFrameworkUntypedD.dll and CPPCimFrameworkD.dll 
   files, compile the CimFramework projects in debug mode (located in 
   WS-ManagementCPPModule package).
6. In order to compile the sample code in debug mode you need to put the files
   CPPCimFrameworkUntypedD.lib, CPPCimFrameworkD.lib and CimOpenWsmanClientD.lib 
   in the \Src\Common\Lib folder.
7. This sample supports the following operations:
   * Discovery: 
     Perform discovery test on the Intel(R) AMT device using the -discovery 
     option.
     The discovery test retrieves the system's allowed control modes and the
     current control mode.
   * Setup:
     Perform a setup of an Intel(R) AMT device in client control mode using the
     -setup option with the network password given using the -newpass option.
	 For ME16.1 and up use the -adaptername flag to determine on which adapter
	 to perform DHCP refresh, in case AMT is disabled.
         For ME19 and above, Setup is done over TLS. It also invokes CommitChanges() 
         to complete the setup flow. 
     After the setup is done, the device will be ready to be configured.
   * Disable:
     Disable the client control mode of an Intel(R) AMT device using the
     -disable option.
     Since this operation is irreversible (once client control mode is disabled
     it cannot be enabled), one must use the -force option (along with the
     -disable option) to actually disable the client control mode.
   * Unprovision:
     Perform an unprovision of an Intel(R) AMT device in client control mode
     using the -unprovision option.

-------------------------------------------------------------------
* Other names and brands may be claimed as the property of others.
